{template "mheader.html"}

<script>
    var syncing = 0;


    function sync_web() {
        if (syncing == 1) {
            dr_cmf_tips(0, '正在连接服务器');
            return;
        }
        syncing = 1;
        $('#dr_sync_html').html('<font color="blue">正在与网站进行数据传输...</font>');
        $.ajax({
            type: "GET",
            dataType: "json",
            url: "{dr_member_url('fclient/home/sync_web')}&id={$id}",
            success: function(json) {
                if (json.code) {
                    $('#dr_sync_html').html('<font color="green">'+json.msg+'</font>');
                } else {
                    layer.open({
                        type: 1,
                        title: '通信失败',
                        closeBtn: 0, //不显示关闭按钮
                        shadeClose : true,
                        scrollbar: false,
                        content: '<div style="padding: 30px;">'+json.msg+'</div>'
                    });
                    $('#dr_sync_html').html('<font color="red">通信失败</font>');
                }
                syncing = 0;
            },
            error: function(HttpRequest, ajaxOptions, thrownError) {
                //alert(HttpRequest.responseText);
                $('#dr_sync_html').html('<font color="red">发生异常，检查网络</font>');
                syncing = 0;
            }
        });
    }

</script>

<div class="portlet light ">
    <div class="portlet-title tabbable-line">
        <ul class="nav nav-tabs" style="float:left;">
            {loop $top_nav $i $t}
            <li class="{if $mvalue==$i}active{/if}">
                <a href="{dr_member_url('fclient/home/'.$i)}&id={$id}"> <i class="{$t.icon}"></i> {$t.name} </a>
            </li>
            {/loop}
        </ul>
    </div>
    <div class="portlet-body form fc-form">
        <form action="" class="form-horizontal" method="post" name="myform" id="myform">
            <div class="form-group">
                <label class="col-md-3 control-label">网站名称</label>
                <div class="col-md-9">
                    <p class="form-control-static"> {$name} </p>
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-3 control-label">网站域名</label>
                <div class="col-md-9">
                    <a href="{$domian}" target="_blank" class="form-control-static"> {$domain} </a>
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-3 control-label"> 网站状态 </label>
                <div class="col-md-9">
                    <p class="form-control-static"> {dr_fstatus($status)} </p>
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-3 control-label"> 使用期限 </label>
                <div class="col-md-9">
                    <p class="form-control-static"> {dr_date($inputtime, 'Y-m-d')} ~ {dr_date($endtime, 'Y-m-d')} </p>
                </div>
            </div>

            <div class="form-group">
                <label class="col-md-3 control-label"> 网站操作 </label>
                <div class="col-md-9" style="padding-top: 8px;">
                    <p class="help-block margin-bottom-15" id="dr_sync_html"> &nbsp; </p>

                    <p class="help-block"><a href="javascript:sync_web();" class="btn btn-sm red">
                        <i class="fa fa-cog"></i> 与客户端通信 </a></p>
                    <p class="help-block"> 将网站信息同步到客户端网站中 </p>


                    <p class="help-block margin-top-15"><a target="_blank" href="{dr_member_url(APP_DIR.'/home/sync_admin')}&id={$id}" class="btn btn-sm green">
                        <i class="fa fa-user"></i> 登录网站后台 </a></p>
                    <p class="help-block"> 登录客户端网站后台进行数据维护操作 </p>

                    <p class="help-block margin-top-15">
                        <a href="{dr_member_url(APP_DIR.'/home/down')}&id={$id}" class="btn btn-sm blue">
                            <i class="fa fa-plus"></i> 下载客户端通信程序 </a></p>
                    <p class="help-block"> 将程序下载后上传到目标服务器web目录中，再进行"通信"操作 </p>


                </div>
            </div>
        </form>
    </div>
</div>



{template "mfooter.html"}